//-----------------------------------------------------------------------------
//	File: mgui_config.c
//	Author: xialing
//		configuration of mgui
//-----------------------------------------------------------------------------

#ifndef __MGUI_CONFIG_H__
#define __MGUI_CONFIG_H__

#include "ssd1306_i2c.h"
#include "mgui_font.h"

// mgui lcd size
#define LCD_XSIZE  128
#define LCD_YSIZE  64

// mgui lcd size
#define MGUI_XSIZE  (LCD_XSIZE - 1)
#define MGUI_YSIZE  (LCD_YSIZE - 1)

// type define
typedef signed char			int8_t;
typedef signed short int	int16_t;
typedef signed int			int32_t;
typedef unsigned char		uint8_t;
typedef unsigned short int	uint16_t;
typedef unsigned int		uint32_t;

// mgui configuration type define
typedef struct MguiFont_Type MguiFont_TypeDef;
typedef struct MguiConf_Type {
	uint16_t xsize; // lcd width
	uint16_t ysize; // lcd height
	uint8_t invc; // invert color
	MguiFont_TypeDef *font;
} MguiConf_TypeDef;

// mgui configuration
extern MguiConf_TypeDef *mgui_conf;

//-----------------------------------------------------------------------------
//	mgui_draw_pixel - draw a pixel, mgui api
//		@x: x position
//		@y: y position
//		@c: 0=0; 1=1; 2=inv
//-----------------------------------------------------------------------------
void mgui_draw_pixel(uint16_t x, uint16_t y, uint8_t c);

//-----------------------------------------------------------------------------
//	mgui_get_pixel - read a pixel, mgui api
//		@x: x position
//		@y: y position
//		@return: pixel state
//-----------------------------------------------------------------------------
uint8_t mgui_get_pixel(uint16_t x, uint16_t y);

//-----------------------------------------------------------------------------
//	mgui_init - init mgui
//		@conf: configuration of mgui
//-----------------------------------------------------------------------------
void mgui_init(MguiConf_TypeDef *conf);

//-----------------------------------------------------------------------------
//	mgui_set_invc - set mgui invert color
//		@inv: 1=invert; 0=normal
//-----------------------------------------------------------------------------
void mgui_set_invc(uint8_t inv);

//-----------------------------------------------------------------------------
//	mgui_set_font - set mgui font
//		@f: font
//-----------------------------------------------------------------------------
void mgui_set_font(MguiFont_TypeDef *f);

#endif
